package cn.ruituo.adv6;

import java.util.*;

public class Zhujie {
    //注解
    //@开头的
    public static void main(String[] args) {
        List<Integer> list=Arrays.asList(1,2,33,5,24,14,51,9);
        List<Integer> list2=new ArrayList(list);
        Collections.sort(list2,new IntComartor());
        System.out.println(list2);
    }
}
class IntComartor implements Comparator<Integer>{

    @Override
    public int compare(Integer o1, Integer o2) {
        System.out.println(o1+"在和o2做比较："+o2);
        return o2-o1;
    }
}